package com.tchepannou.limbe.validation;

import java.lang.reflect.Field;

/**
 * User: herve
 * Date: 14-01-12 11:45 AM
 */
public abstract class AbstractValidator implements Validator
{
    public Object getValue(Object bean, Field field)
    {
        try
        {
            return field.get(bean);
        }
        catch (Exception e)
        {
            throw new IllegalStateException("Unable to resolve field: " + bean.getClass() + "->" + field.getName(), e);
        }
    }
}
